package com.ruoyi.website.gateway.feign;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

//@FeignClient(name = "ruoyi-forum")
public interface CircleTopicService {

    @Operation(summary = "发表动态", description = "发表动态")
    @Parameters({
            @Parameter(name = "uid", description = "用户id", required = true),
            @Parameter(name = "content", description = "内容"),
            @Parameter(name = "imgs", description = "图片id，以逗号隔开"),
            @Parameter(name = "labelId", description = "话题标签id", required = true)
    })
    @RequestMapping(value = "/circle/topic/save", method = RequestMethod.POST)
    public AjaxResult saveTopic(@RequestParam(value = "uid") String uid,
                                @RequestParam(value = "content", required = false) String content,
                                @RequestParam(value = "imgs", required = false) String imgs,
                                @RequestParam(value = "labelId") String labelId);

    @Operation(summary = "我的动态列表", description = "我的动态列表")
    @Parameters({
            @Parameter(name = "uid", description = "用户id", required = true),
            @Parameter(name = "page", description = "页码", example = "1"),
            @Parameter(name = "rows", description = "条数", example = "10")
    })
    @RequestMapping(value = "/circle/my/topic/list", method = RequestMethod.GET)
    public TableDataInfo getMyCircleTopicList(@RequestParam(value = "uid") String uid,
                                              @RequestParam(value = "page", defaultValue = "1", required = false) Integer page,
                                              @RequestParam(value = "rows", defaultValue = "10", required = false) Integer rows);

    @Operation(summary = "删除我的动态", description = "删除我的动态")
    @Parameters({
            @Parameter(name = "id", description = "动态id", required = true),
            @Parameter(name = "uid", description = "用户id", required = true)
    })
    @RequestMapping(value = "/circle/my/topic/delete", method = RequestMethod.POST)
    public AjaxResult deleteTopic(@RequestParam(value = "id") Long id, @RequestParam(value = "uid") String uid);

    @Operation(summary = "获取所有人圈子动态列表", description = "获取所有人圈子动态列表")
    @GetMapping(value = "/circle/topic/list")
    public AjaxResult listTopic(@Parameter(hidden = true) @ModelAttribute CircleTopicListDTO dto);


    @Operation(summary = "查询动态列表", description = "查询动态列表")
    @GetMapping(value = "/circle/topic/search")
    public TableDataInfo searchTopic(
            @RequestParam String keyword,
            @RequestParam(required = false, defaultValue = "1") Integer pageNo,
            @RequestParam(required = false, defaultValue = "10") Integer pageSize);


    @Operation(summary = "获取我参与的动态列表", description = "获取我参与的动态列表")
    @Parameters({
            @Parameter(name = "uid", description = "用户id", required = true),
            @Parameter(name = "page", description = "页码", example = "1"),
            @Parameter(name = "rows", description = "条数", example = "10")
    })
    @RequestMapping(value = "/circle/topic/ofme/list", method = RequestMethod.GET)
    public TableDataInfo getTopicOfMeList(@RequestParam(value = "uid") String uid, @RequestParam(value = "page", defaultValue = "1", required = false) Integer page,
                                          @RequestParam(value = "rows", defaultValue = "10", required = false) Integer rows);


    @Operation(summary = "获取动态详情", description = "获取动态详情")
    @Parameter(name = "id", description = "动态id", required = true)
    @RequestMapping(value = "/circle/topic/detail", method = RequestMethod.GET)
    public AjaxResult getTopicDetail(@RequestParam(value = "id") Long id, @RequestParam(value = "uid", required = false) String uid);

    @Operation(summary = "获取动态通知数量", description = "获取动态通知数量")
    @Parameter(name = "uid", description = "用户id", required = true)
    @RequestMapping(value = "/circle/topic/notice/num/search", method = RequestMethod.GET)
    public AjaxResult getTopicUnreadNumSearch(@RequestParam(value = "uid", required = false) String uid);

    @Operation(summary = "获取动态通知消息", description = "获取动态通知消息")
    @Parameter(name = "uid", description = "用户id", required = true)
    @RequestMapping(value = "/circle/topic/unread/list/search", method = RequestMethod.GET)
    public AjaxResult getTopicUnreadListSearch(@RequestParam(value = "uid") String uid,
                                               @RequestParam(value = "page", defaultValue = "1", required = false) Integer page,
                                               @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
                                               HttpServletRequest request);

    @Operation(summary = "举报帖子", description = "举报帖子")
    @Parameters({
            @Parameter(name = "topicId", description = "帖子id", required = true),
            @Parameter(name = "uid", description = "用户id", required = true),
            @Parameter(name = "content", description = "举报内容", required = true)
    })
    @PostMapping("/circle/topic/{topicId}/report")
    public AjaxResult reportTopic(@PathVariable Long topicId, @RequestParam String uid, @RequestParam String content);

    @Operation(summary = "获取帖子举报记录列表", description = "获取帖子举报记录列表")
    @Parameters({
            @Parameter(name = "topicId", description = "帖子id", required = true),
            @Parameter(name = "pageNo", description = "页码", example = "1"),
            @Parameter(name = "pageSize", description = "条数", example = "10")
    })
    @GetMapping("/circle/topic/{topicId}/report/list")
    public TableDataInfo listReport(@PathVariable Long topicId,
                                    @RequestParam(required = false, defaultValue = "1") Integer pageNo,
                                    @RequestParam(required = false, defaultValue = "10") Integer pageSize);


}
